<?php

    $cabinet = null;
    $sessionid = null;

    if(isset($_SESSION['cabsessionid']))
    {
        if(isset($_REQUEST["closecabinet"]))
        {
            unset($_SESSION['login']);
            unset($_SESSION['cabsessionid']);
            unset($_SESSION['cabinet']);
            header("Location: /");
        }
        else
        {
            $sessionid = $_SESSION['cabsessionid'];
            $sessionid2 = quote_smart($sessionid);
            $cabinets = $mikron->Queries->Query("T_CABINET", null, "`sessionid` = $sessionid2");
            if($cabinets->count() > 0)
            {
                $cabinet = $cabinets->fetch();
            }
        }
    }

?>